#include "gd32f30x.h"
#include "systick.h"
#include "usart.h"
#include "led.h"

int main(void)
{
	int t = 0;
	systick_config();	/* 配置系统时钟 */
	LED_init();			/* 初始化 LED */	
	uart_init(115200);	/* 初始化USART0 */
	printf("Hello world! \r\n");
    while(1)
	{
		if(USART_RX_NUM > 0)
		{
			printf("RECV %d date:%s\r\n", USART_RX_NUM, rx0_date_buf);
			USART_RX_NUM = 0;
		}
		
		delay_1ms(10);
		t++;
		if(t % 200 == 0) LED(0);
		else if(t % 200 == 100) LED(1);
    }
}

